#include "Point.h"
#include <math.h>


Point::Point(void)
{
}

Point::Point(float x, float y, float z)
{
	this->x = x;
	this->y = y;
	this->z = z;
}

Point::~Point(void)
{
}

float Point::distance(void)
{
	return sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2));
}

float Point::distance(Point p)
{
	return sqrt(pow(this->x - p.getValue(Point::X), 2) + pow(this->y - p.getValue(Point::Y), 2) + pow(this->z - p.getValue(Point::Z), 2));
}

float Point::getValue(coordinate c)
{
	if(c == X) return this->x;
	else if(c == Y) return this->y;
	else if(c == Z) return this->z;
	else return -1;
}